package com.paomi.client.activity.person.presenter;

import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
import com.hannesdorfmann.mosby3.mvp.MvpView;
import com.paomi.client.activity.person.View.MyPointView;
import com.paomi.client.activity.person.model.GetBalanceBean;
import com.paomi.client.activity.person.model.TaskListBean;
import com.paomi.client.bean.BaseJSON;
import com.paomi.client.net.Api;
import com.paomi.client.net.BaseCallback;
import com.paomi.client.net.Constants;

import retrofit2.Call;

public class MyPointPre extends MvpBasePresenter<MyPointView> {

    /**
     * 获取积分任务列表
     */
    public void getTaskList(){
        Api.getInstanceService(Constants.User_URL).getTaskList().enqueue(new BaseCallback<TaskListBean>() {
            @Override
            public void onResponse(Call<TaskListBean> call, TaskListBean result) {
                getView().showTaskList(result);
            }
        });
    }
    /**
     * 获取积分余额
     */
    public void getBalance(){
        Api.getInstanceService(Constants.User_URL).getTaskBalance().enqueue(new BaseCallback<GetBalanceBean>() {
            @Override
            public void onResponse(Call<GetBalanceBean> call, GetBalanceBean result) {
                getView().showTaskBalance(result);
            }
        });
    }
}